<?php

class Application_Model_LogManager
{
	public static function wirtelog($param){
		$date=new DateTime();
		$year=$date->format("Y");
		$month=$date->format('m');
		$dateStr=$date->format("d");
		
		$dir=$_SERVER["DOCUMENT_ROOT"]."/SystemLogs/";
		$curLog=$dir."errorLog-".$year."-".$month."-".$dateStr.".txt";
		touch($curLog);
            $fp = fopen($curLog, "a");
            if ($fp) {
            	fwrite($fp, "\r\n");
            	fwrite($fp, "Error: ".$date->format("Y-m-d H:i:s")."\r\n");
                fwrite($fp, $param."\r\n");
                fclose($fp);
            }
           
	}

}

